import * as actionTypes from './constants';
import { getSearchList } from '@/services/search';
const changeSearchListAction = ({ result }) => ({
  type: actionTypes.UPDATE_SEARCH,
  result
})


export const getSearchListAction = (str) => {
  return dispatch => {
    getSearchList(str).then(res => {
      dispatch(changeSearchListAction(res))
    })
  }
}
